using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Dimok.Exceptions;
using Data;

namespace Dimok.Aspx.Manager.Underwriting {
	public partial class DriverLicense : System.Web.UI.Page {
		protected void Page_Load(object sender, System.EventArgs e) {
			try{
				UOX uox = new UOX();
				string html = SQL.ExecuteScalarEx(uox.db,"SELECT ISNULL(DriverLicenseHTML,'') FROM v_Borrower_0 WHERE LoanID=@LoanID",uox.applIDSec)+"";
				if( html == "" ){
					html = uox.Accurint.DriverLicense();
					SQL.UpdateField(uox.db,"SELECT * FROM t_Borrower WHERE ID="+uox.ApplInfo.BorrowerID(0),"DriverLicenseHTML",html);
				}
				Response.Write(html);
			}catch(Exception exc){ throw new ClientException(exc); }
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e) {
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {    
		}
		#endregion
	}
}
